home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / CARDATA.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  852b  |  31 lines

  1. ' CARDATA.BAS
  2. ' This program uses the PRINT# statement to send three lines of
  3. '   car information to a sequential file.
  4.  
  5. OPEN "CARDATA.TXT" FOR OUTPUT AS #1  ' open file in current drive/dir
  6.  
  7. CLS
  8.  
  9. ' get some car information from the user and write it to the open file
  10.  
  11. INPUT "Enter the make of a car in your collection:  ", makeName$
  12. INPUT "What is the model name?  ", modelName$
  13. INPUT "What year was the car made?  ", year%
  14.  
  15. PRINT #1, makeName$, modelName$, year%
  16.  
  17. ' add some literal values to the file
  18.  
  19. PRINT #1, "Mercedes-Benz", "190 SL", 1959
  20.  
  21. ' add a new car to the file (RIGHT$ function returns current year
  22. '   from DATE$ function)
  23.  
  24. PRINT #1, "Audi", "80 Quattro", " "; RIGHT$(DATE$, 4)
  25.  
  26. CLOSE #1                             ' close the file
  27.  
  28. PRINT
  29. PRINT "Information has been successfully written to CARDATA.TXT"
  30.  
  31.